package yao.xiao.liu;

import android.app.Activity;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Xml;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import yao.xiao.liu.R;

public class MainActivity extends Activity implements OnClickListener{
   private TextView textView;
   private ImageView imageView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        textView=(TextView) this.findViewById(R.id.text);
        textView.setOnClickListener(this);
        imageView=(ImageView) super.findViewById(R.id.image);
        imageView.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Toast.makeText(MainActivity.this, "成功", Toast.LENGTH_LONG).show();
				XmlResourceParser parser=getResources().getXml(R.layout.main);
			AttributeSet attributeSet=Xml.asAttributeSet(parser);
			System.out.println(attributeSet.getAttributeName(0));
				
			}
        	
        });
    }
	@Override
	public void onClick(View v) {
		Toast.makeText(MainActivity.this, "成功成功", Toast.LENGTH_LONG).show();
		
	}
}